{ pkgs, ... }:

let
  vscodeExtensions = with pkgs.vscode-extensions; [
    aaron-bond.better-comments
    bierner.markdown-mermaid
    bmewburn.vscode-intelephense-client
    bradlc.vscode-tailwindcss
    charliermarsh.ruff
    continue.continue
    dart-code.dart-code
    dart-code.flutter
    davidanson.vscode-markdownlint
    dbaeumer.vscode-eslint
    denoland.vscode-deno
    eamodio.gitlens
    esbenp.prettier-vscode
    foxundermoon.shell-format
    golang.go
    graphql.vscode-graphql-syntax
    gruntfuggly.todo-tree
    jnoortheen.nix-ide
    jock.svg
    ms-azuretools.vscode-docker
    ms-ceintl.vscode-language-pack-zh-hans
    ms-python.debugpy
    ms-python.python
    ms-python.vscode-pylance
    ms-toolsai.jupyter
    ms-toolsai.jupyter-keymap
    ms-toolsai.jupyter-renderers
    ms-toolsai.vscode-jupyter-cell-tags
    ms-toolsai.vscode-jupyter-slideshow
    ms-vscode.powershell
    ms-vscode-remote.remote-containers
    ms-vscode-remote.remote-ssh
    redhat.java
    redhat.vscode-xml
    rust-lang.rust-analyzer
    shd101wyy.markdown-preview-enhanced
    svelte.svelte-vscode
    tamasfe.even-better-toml
    visualstudioexptteam.vscodeintellicode
    vue.volar
    ziglang.vscode-zig
    zxh404.vscode-proto3
  ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
    {
      name = "better-prolog-syntax";
      publisher = "jeff-hykin";
      version = "0.3.2";
      sha256 = "P3zeOaZB4sy7hCVSu/WQwvuyj+qXwwfbcdNCRg1T0EM=";
    }
    {
      name = "cpptools";
      publisher = "ms-vscode";
      version = "1.21.6";
      sha256 = "Xz13SrylHWCJksdd/5UwY7p0aPEnYyhgrUlxyQVqWT4=";
    }
    {
      name = "cython";
      publisher = "tcwalther";
      version = "0.1.0";
      sha256 = "6oSVYnn1XeiZ1H3hqcdc22ejQaLVR9zrUQEGlwry1Pc=";
    }
    {
      name = "js-unicode-preview";
      publisher = "adpyke";
      version = "1.1.4";
      sha256 = "8BSUgFfIeWX+GrQ1AM1cNg6JGRqgaBobph5YRrbiifs=";
    }
    {
      name = "korofileheader";
      publisher = "obkoro1";
      version = "4.9.3";
      sha256 = "I7oVs6ojLkqC3nUKgrRfOuFhAfCjI10zJrBTFazK9s4=";
    }
    {
      name = "kotlin";
      publisher = "fwcd";
      version = "0.2.35";
      sha256 = "UyiMacHjs8tbziQzrGlP5A+OSNuzIij1yFBTRuM6qmM=";
    }
    {
      name = "nas-vscode";
      publisher = "rights";
      version = "0.0.1";
      sha256 = "8KpqO4v//i0k8/OrbPirvJkTwB0aL6svRYqiiuwmkXY=";
    }
    {
      name = "platformio-ide";
      publisher = "platformio";
      version = "3.3.3";
      sha256 = "d8kwQVoG/MOujmvMaX6Y0wl85L2PNdv2EnqTZKo8pGk=";
    }
    {
      name = "smalise";
      publisher = "loyieking";
      version = "0.0.12";
      sha256 = "GZjurKTwqGO5Hxv6HYxHr9Sy+srZMxOsialL8B+kjV8=";
    }
    {
      name = "vscode-choosealicense";
      publisher = "ultram4rine";
      version = "0.9.4";
      sha256 = "YmZ1Szvcv3E3q8JVNV1OirXFdYI29a4mR3rnhJfUSMM=";
    }
    {
      name = "vscode-mojo";
      publisher = "modular-mojotools";
      version = "24.4.0";
      sha256 = "/UJmySWkjVr4vJ3wpsRsDq/V+aEr4Ma9CNU40BCwzbg=";
    }
    {
      name = "vscode-office";
      publisher = "cweijan";
      version = "3.3.10";
      sha256 = "ThFI5D7RnSXO+3bAYZ5Momx3l9sb07l9qmzxHNk1QH4=";
    }
    {
      name = "remote-wsl";
      publisher = "ms-vscode-remote";
      version = "0.88.2";
      sha256 = "fl7fLNd3EHA9eMiPUIL/23SUiA81gveqZLFkqaHTX+Q=";
    }
  ];
in
{
  home.packages = with pkgs; [
    # bun
    # cargo-generate
    # cocoapods
    # deno
    # dotnet-sdk
    # ffmpeg
    # flutter
    # go
    # inetutils
    # npm-check-updates
    nixpkgs-fmt
    # php
    # rustup
    # tesseract
    # wasm-pack
    # zig
  ];

  programs = {
    vscode = {
      enable = true;

      extensions = vscodeExtensions;

      userSettings = {
        "[c]" = {
          "editor.defaultFormatter" = "ms-vscode.cpptools";
        };
        "[cpp]" = {
          "editor.defaultFormatter" = "ms-vscode.cpptools";
        };
        "[dockerfile]" = {
          "editor.defaultFormatter" = "ms-azuretools.vscode-docker";
        };
        "[dotenv]" = {
          "editor.defaultFormatter" = "foxundermoon.shell-format";
        };
        "[go]" = {
          "editor.defaultFormatter" = "golang.go";
        };
        "[html]" = {
          "editor.defaultFormatter" = "vscode.html-language-features";
        };
        "[ignore]" = {
          "editor.defaultFormatter" = "foxundermoon.shell-format";
        };
        "[java]" = {
          "editor.defaultFormatter" = "redhat.java";
        };
        "[kotlin]" = {
          "editor.defaultFormatter" = "fwcd.kotlin";
        };
        "[nix]" = {
          "editor.defaultFormatter" = "jnoortheen.nix-ide";
        };
        "[php]" = {
          "editor.defaultFormatter" = "bmewburn.vscode-intelephense-client";
        };
        "[python]" = {
          "editor.defaultFormatter" = "charliermarsh.ruff";
        };
        "[rust]" = {
          "editor.defaultFormatter" = "rust-lang.rust-analyzer";
        };
        "[shellscript]" = {
          "editor.defaultFormatter" = "foxundermoon.shell-format";
        };
        "[toml]" = {
          "editor.defaultFormatter" = "tamasfe.even-better-toml";
        };
        "[typescript]" = {
          "updateImportsOnFileMove.enabled" = "always";
        };
        "[xml]" = {
          "editor.defaultFormatter" = "redhat.vscode-xml";
        };

        "editor.bracketPairColorization.independentColorPoolPerBracketType" = true;
        "editor.codeActionsOnSave" = {
          "source.fixAll" = "always";
          "source.organizeImports" = "always";
        };
        "editor.defaultFormatter" = "esbenp.prettier-vscode";
        "editor.fontFamily" = "Senkita";
        "editor.fontLigatures" = true;
        "editor.fontSize" = 14;
        "editor.formatOnPaste" = false;
        "editor.formatOnSave" = true;
        "editor.formatOnType" = true;
        "editor.indentSize" = "tabSize";
        "editor.renderWhitespace" = "all";
        "editor.wordWrap" = "bounded";


        "fileheader.configObj" = {
          "CheckFileChange" = false;
          "NoMatchParams" = "no show param";
          "afterAnnotation" = {
            "文件后缀" = "该文件后缀的头部注释之后添加某些内容";
          };
          "annotationStr" = {
            "end" = " */";
            "head" = "/*";
            "middle" = " * @";
            "use" = false;
          };
          "atSymbol" = [ "@" "@" ];
          "atSymbolObj" = {
            "文件后缀" = [ "头部注释@符号" "函数注释@符号" ];
          };
          "autoAdd" = false;
          "autoAddLine" = 100;
          "autoAlready" = true;
          "beforeAnnotation" = {
            "文件后缀" = "该文件后缀的头部注释之前添加某些内容";
          };
          "colon" = [ ": " ": " ];
          "colonObj" = {
            "文件后缀" = [ "头部注释冒号" "函数注释冒号" ];
          };
          "createFileTime" = true;
          "createHeader" = false;
          "cursorModeInternalAll" = { };
          "customHasHeadEnd" = { };
          "dateFormat" = "YYYY-MM-DD HH:mm:ss";
          "designAddHead" = false;
          "filePathColon" = "路径分隔符替换";
          "folderBlacklist" = [ "node_modules" ];
          "functionBlankSpaceAll" = { };
          "functionParamAddStr" = "";
          "functionParamsShape" = [ "{" "}" ];
          "functionTypeSymbol" = "*";
          "functionWideNum" = 13;
          "headDesign" = false;
          "headDesignName" = "random";
          "headInsertLine" = {
            "php" = 2;
            "sh" = 2;
          };
          "language" = {
            "blade.php" = {
              "end" = "-->";
              "head" = "<!--";
              "middle" = " * @";
            };
            "h/hpp/cpp" = {
              "end" = " */";
              "head" = "/*** ";
              "middle" = " * @";
            };
            "js" = {
              "end" = " $/";
              "functionParams" = "typescript";
              "functionSymbol" = {
                "end" = " */";
                "head" = "/******* ";
                "middle" = " * @";
              };
              "head" = "/$$";
              "middle" = " $ @";
            };
            "languagetest" = {
              "end" = " $/";
              "functionParams" = "js";
              "functionSymbol" = {
                "end" = " */";
                "head" = "/** ";
                "middle" = " * @";
              };
              "head" = "/$$";
              "middle" = " $ @";
            };
          };
          "moveCursor" = true;
          "openFunctionParamsCheck" = true;
          "prohibitAutoAdd" = [ "html" "md" "json" ];
          "prohibitItemAutoAdd" = [ "项目的全称禁止项目自动添加头部注释, 使用快捷键自行添加" ];
          "showErrorMessage" = false;
          "specialOptions" = {
            "特殊字段" = "自定义比如LastEditTime/LastEditors";
          };
          "supportAutoLanguage" = [ ];
          "switch" = {
            "newlineAddAnnotation" = true;
          };
          "throttleTime" = 60000;
          "typeParamOrder" = "type param";
          "useWorker" = false;
          "wideNum" = 13;
          "wideSame" = true;
          "writeLog" = false;
        };
        "fileheader.cursorMode" = {
          "description" = "";
          "param" = "";
          "return" = "";
        };
        "fileheader.customMade" = {
          "Author" = "Senkita";
          "Date" = "Do not edit";
          "LastEditors" = "Senkita";
          "LastEditTime" = "Do not edit";
          "Description" = "";
        };

        "files.autoSave" = "onFocusChange";

        "fittencode.languagePreference.displayPreference" = "zh-cn";
        "fittencode.syntaxHighlighting.useVisualStudioCodeColors" = true;

        "license.author" = "Senkita";

        "markdown-preview-enhanced.codeBlockTheme" = "one-dark.css";
        "markdown-preview-enhanced.previewTheme" = "night.css";

        "notebook.formatOnSave.enabled" = true;
        "notebook.lineNumbers" = "on";

        "parallels-desktop.brew.path" = "/usr/local/bin/brew";
        "parallels-desktop.extension.path" = "/Users/daria/.parallels-desktop-vscode";
        "parallels-desktop.hashicorp.packer.path" = "/usr/local/bin/packer";
        "parallels-desktop.hashicorp.vagrant.parallels.plugin" = true;
        "parallels-desktop.hashicorp.vagrant.path" = "/usr/local/bin/vagrant";
        "parallels-desktop.git.path" = "/Users/daria/.nix-profile/bin/git";
        "parallels-desktop.prlctl.path" = "/usr/local/bin/prlctl";

        "platformio-ide.customPATH" = " /usr/local/bin";
        "platformio-ide.customPyPiIndexUrl" = "https://pypi.tuna.tsinghua.edu.cn/simple";

        "python.analysis.autoImportCompletions" = true;
        "python.analysis.inlayHints.callArgumentNames" = true;
        "python.analysis.inlayHints.functionReturnTypes" = true;
        "python.analysis.inlayHints.pytestParameters" = true;
        "python.analysis.inlayHints.variableTypes" = true;
        "python.analysis.typeCheckingMode" = "basic";

        "redhat.telemetry.enabled" = false;

        "terminal.integrated.inheritEnv" = true;

        "vue.server.hybridMode" = true;

        "window.commandCenter" = false;

        "workbench.activityBar.location" = "top";
        "workbench.colorTheme" = "One Dark Modern";
        "workbench.editorAssociations" = {
          "*.md" = "default";
          "{git,gitlens}:/**/*.{md,csv}" = "default";
          "{git,gitlens}:/**/*.{md,csv,svg}" = "default";
        };
        "workbench.editor.editorActionsLocation" = "hidden";
        "workbench.iconTheme" = "office-material-icon-theme";
        "workbench.layoutControl.enabled" = false;
        "workbench.sideBar.location" = "right";
      };
    };
  };
}
